<template>
	<view>
		<view class=""  style="margin-top: 200rpx;">
			<button type="primary" @click="takePhoto">拍照</button>
		</view>
	</view>
</template>

<script>
	let _this = null;
	export default {
		data() {
			return {

			};
		},
		onLoad(e) {

		},
		onReady() {

		},
		onShow() {

		},
		onUnload() {

		},
		methods: {
			takePhoto() {
				const camera = plus.camera.getCamera();
				camera.captureImage(
					function(path) {
						// 成功拍照的回调函数
						console.log('拍照成功:', path);
						// 处理图片路径，例如显示图片或上传
					},
					function(error) {
						// 拍照失败的回调函数
						console.error('拍照失败:', error.message);
					}, {
						// 拍照参数配置
						filename: '_doc/camera/', // 保存图片的路径
						index: 1 // 前置摄像头
					}
				);
			}

		}
	};
</script>

<style lang="less">
	.live-camera {
		justify-content: center;
		align-items: center;

	}

	.preview {
		justify-content: center;
		align-items: center;

	}

	.remind {
		position: absolute;
		top: 80rpx;
		left: 20rpx;

		z-index: 100;
	}

	.remind-text {
		color: #dddddd;

		width: 710rpx;
	}

	.remind-name {
		font-size: 40rpx;
	}

	.remind-address {
		font-size: 36rpx;
	}

	.remind-time {
		font-size: 30rpx;
	}


	.menu {
		position: absolute;
		left: 0;
		bottom: 0;
		width: 750rpx;
		height: 180rpx;
		z-index: 98;
		align-items: center;
		justify-content: center;
	}

	.menu-mask {
		position: absolute;
		left: 0;
		bottom: 0;
		width: 750rpx;
		height: 180rpx;
		z-index: 98;
	}

	.menu-back {
		position: absolute;
		left: 30rpx;
		bottom: 50rpx;
		width: 80rpx;
		height: 80rpx;
		z-index: 99;
		align-items: center;
		justify-content: center;
	}

	.menu-snapshot {
		width: 130rpx;
		height: 130rpx;
		z-index: 99;
	}

	.menu-flip {
		position: absolute;
		right: 30rpx;
		bottom: 50rpx;
		width: 80rpx;
		height: 80rpx;
		z-index: 99;
		align-items: center;
		justify-content: center;
	}
</style>